<?php 

    /**
     * 
     */
    class Home_model extends CI_Model {
        var $table 			= "crawler_content";
        var $table_question = "ans_question";
        var $table_cate		= "ans_category";
        function __construct() {
            parent::__construct();
        }
        
        #For Solr's Core number 1
        function get(){
          	$res	=	$this->db->select('id,title,text')
          						 ->order_by('id', 'ASC')
          						 ->get($this->table)	
          						 ->result_array();
          	return $res;
          						 
        }
        
        
        #--------------------------------------------------------
        # For Solr's Core number 2
        function get_question(){
        	$res = $this->db->select('id, cate_id, cate_name, brief, brief_ascii, detail, sender, sender_email')
        					->get($this->table_question)
        					->result_array();
        	return $res;
        }
        
        
        function get_question_cate(){
        	$res = $this->db->select()
        					->get($this->table_cate)
        					->result_array();
        	return $res;
        }
        
    }
    